package com.liwei.vip.mall.goods.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liwei.vip.mall.goods.mapper.SkuAttributeMapper;
import com.liwei.vip.mall.goods.model.SkuAttribute;
import com.liwei.vip.mall.goods.service.SkuAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SkuAttributeServiceImpl extends ServiceImpl<SkuAttributeMapper, SkuAttribute> implements SkuAttributeService {

    @Autowired
    private SkuAttributeMapper skuAttributeMapper;

    /**
     * 根据分类ID查询属性ID集合
     * <p>
     * 根据属性ID集合查询属性集合
     *
     * @param id:分类ID
     */
    @Override
    public List<SkuAttribute> queryList(Integer id) {
//        QueryWrapper<SkuAttribute> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("attr_id", id);
//        return skuAttributeMapper.selectList(queryWrapper);
        return skuAttributeMapper.queryByCategoryId(id);
    }
}
